package com.suixun.service.mongodb;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

import com.suixun.dao.mongodb.BaiduoffsetDao;
import com.suixun.entity.mongodb.Baiduoffset;
import com.suixun.util.db.MongoDBPagination;

@Service("baiduoffsetService")
public class BaiduoffsetService {

    @Resource(name = "baiduoffsetDao")
	private BaiduoffsetDao baiduoffsetDao;

	public Baiduoffset findByid(int id) {
		return baiduoffsetDao.findById(id);
	}

	public Baiduoffset findOne(Map<String, String> params) {
		return this.baiduoffsetDao.findOne(params);
	}
	
	public List<Baiduoffset> find(Query query) {
        return this.baiduoffsetDao.find(query);
    }
	
	public Baiduoffset save(Baiduoffset bean) {
		return baiduoffsetDao.save(bean);
	}

	public MongoDBPagination<Baiduoffset> getPageArticle(int pageNo, int pageSize) {
		return baiduoffsetDao.getPageArticle(pageNo, pageSize);
	}

	/**
	 * 暂时只是固定去修改,会有下一篇博客,写高级修改...
	 */
	public void update(String id, Map<String, String> params) {
		this.baiduoffsetDao.updateEntity(id, params);
	}
}
